E - This parameter is a generic for the type of elements that will be stored in
the linked list.public class LinkedListNode<E>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private E |
element |
private LinkedListNode<E> |
next |
| Constructor and Description |
|---|
LinkedListNode(E element)
Constructor LinkedListNode class.
|
| Modifier and Type | Method and Description |
|---|---|
E |
getElement()
Getter method to obtain a reference to the Object held by the LinkedListNode.
|
LinkedListNode<E> |
getNext()
Getter method to obtain a reference to the next LinkedListNode in the Linked List.
|
void |
setElement(E element)
Setter method to set the reference to the Object held by the LinkedListNode.
|
void |
setNext(LinkedListNode<E> next)
Setter method to set the reference to the next LinkedListNode in the Linked List.
|
private E element
private LinkedListNode<E> next
public LinkedListNode(E element)
null.element - This is the element Object held by the LinkedListNode.public E getElement()
public void setElement(E element)
element - The reference to the Object to be held by the LinkedListNode.public LinkedListNode<E> getNext()
public void setNext(LinkedListNode<E> next)
next - The reference to the next LinkedListNode in the Linked List.